/************************************************************
 * $Id : CCmdHello.cpp   2011/08/01
 *
 *       swhors@naver.com
 ************************************************************/

#include "config.h"

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>

using namespace std;

#include "constant.h"
#include "ast_peg.h"
#include "ast_db.h"
#include "CmdBase.h"
#include "CmdHello.h"

#include "ast_event.h"

extern char  gOutgoingFolder[256];
extern int   gIsConnected2DB;

extern int sendCommand( char *fmt, ...);

CCmdHello::CCmdHello()
{
    init( );
}

CCmdHello::~CCmdHello()
{
    init( );
}

void CCmdHello::release()
{
    super::release();
}

void CCmdHello::init()
{
    super::init();

    mVerMax = 0;
    mVerMin = 0;
}

void *CCmdHello::parse( char * aCommandStr )
{
    char * sMatchedStr   = NULL;
    char * sCurLine      = aCommandStr;
    char * sContent[128] = {0,};

    super::parse( aCommandStr );

    if ( version_f::Matches( sCurLine, sMatchedStr ) )
    {
    }

    return this;
}

CCmdHello & CCmdHello::operator = ( const CCmdHello & aOther )
{
    mVerMax = aOther.mVerMax;
    mVerMin = aOther.mVerMin;

    return *this;
}

int CCmdHello::operator < ( const CCmdHello &aOther )
{
    if( mVerMax >= aOther.mVerMax )
    {
        goto notless;
    }
    if( mVerMin >= aOther.mVerMin )
    {
        goto notless;
    }
    return 1;

    notless:

    return 0;
}

int CCmdHello::operator > ( const CCmdHello & aOther )
{
    if( mVerMax <= aOther.mVerMax )
    {
        goto notmore;
    }
    if( mVerMin <= aOther.mVerMin )
    {
        goto notmore;
    }
    return 1;
notmore:
    return 0;
}

int CCmdHello::operator == ( const CCmdHello & aOther )
{
    if( mVerMax != aOther.mVerMax )
    {
        goto notequal;
    }
    if( mVerMin != aOther.mVerMin )
    {
        goto notequal;
    }
    return 1;
notequal:
    return 0;
}
